package com.zr.andealib.util.frequency;

import android.util.Log;

import com.jietong.rfid.uhf.callback.CallBack;
import com.jietong.rfid.util.EPC;
import com.zr.andealib.util.HardEvent;
import com.zr.andealib.util.constant.AndeaConstant;

import org.greenrobot.eventbus.EventBus;

/**
 * @auther EnzoChan
 * created:2019/6/18
 * desc:
 */
public class DataShowInfo implements CallBack.R2000 {

    @Override
    public void readData(String data, String rssi, String antennaNo, String deviceNo, String direction, String communicationMode) {

        EPC epcTag = new EPC();
        epcTag.setId(1);
        //新旧标签
        if (data.substring(0,12).equals("000000000000"))
            epcTag.setEpc(data.substring(data.length() - 12, data.length()));
        else
            epcTag.setEpc(data);
        epcTag.setAnt(antennaNo);
        epcTag.setCount(1);
        EventBus.getDefault().post(new HardEvent(epcTag, AndeaConstant.CALL_READ_CHECK_SUCCSES));
    }
}

